package ltd.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
//JPA提供的四种标准用法为TABLE,SEQUENCE,IDENTITY,AUTO. 
//TABLE：使用一个特定的数据库表格来保存主键。 
//SEQUENCE：根据底层数据库的序列来生成主键，条件是数据库支持序列。 
//IDENTITY：主键由数据库自动生成（主要是自动增长型） 
//AUTO：主键由程序控制。 


@Entity
@Table(name = "game")
public class Game {
	
	private int id;
	private String gname;
	private int chid;
	private String gpack;
	private String gpinyin;
	
	public Game() {
		super();
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}

	@Column(name="gname", length=100, nullable=false)
	public String getGname() {
		return gname;
	}
	public void setGname(String gname) {
		this.gname = gname;
	}
	
	@Column(name="chid", nullable=false)
	public int getChid() {
		return chid;
	}
	public void setChid(int chid) {
		this.chid = chid;
	}

	@Column(name="gpack", length=100, nullable=true)
	public String getGpack() {
		return gpack;
	}
	public void setGpack(String gpack) {
		this.gpack = gpack;
	}

	@Column(name="gpinyin", length=50, nullable=true)
	public String getGpinyin() {
		return gpinyin;
	}
	public void setGpinyin(String gpinyin) {
		this.gpinyin = gpinyin;
	}

}
